$(function(){
    function init(){
        bindEvent();
    }

    function bindEvent(){
        //删除签到配置
        $("#list-table .delete").click(function(){
            var id = $(this).attr("data-id");
            var _this = $(this);
            myConfirmModal("确定删除签到配置吗？",function(){
                $.ajax({
                    url:"deleteSign",
                    type:"post",
                    data:{"ids":id},
                    dataType:"json",
                    beforeSend:function(xhr){
                        //显示“加载中。。。”
                        $("#loading").modal('show');
                    },
                    complete:function(){
                        //隐藏“加载中。。。”
                        $("#loading").modal('hide');
                    },
                    success:function(json,statusText){
                        if(json.errorCode == 0){
                            _this.parents("tr").remove();
                        }else{
                            responseTip(json.errorCode,json.errorInfo,1500);
                        }
                    },
                    error:errorResponse
                });
            });

        });
    }

    init();
});